Fix xm info handling of empty strings (fix bugzilla bug #216)
authorshand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Fri, 9 Sep 2005 23:11:18 +0000 (15:11 -0800)
committershand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Fri, 9 Sep 2005 23:11:18 +0000 (15:11 -0800)
Signed-off-by: Steven Hand <steven@xensource.com>
tools/python/xen/xm/main.py

index 92782d2ae9a47aa742182b45e545c5a0e0f239f2..b031081fe15f7a27e4a3481417f4904df76e113d 100644 (file)
@@ -450,7 +450,10 @@ def xm_info(args):
     info = server.xend_node()
     
     for x in info[1:]:
-        print "%-23s:" % x[0], x[1]
+        if len(x) < 2: 
+            print "%-23s: (none)" % x[0]
+        else: 
+            print "%-23s:" % x[0], x[1]
 
 # TODO: remove as soon as console server shows up
 def xm_console(args):